/*
 * Zenlayer.com Inc.
 * Copyright (c) 2014-2021 All Rights Reserved.
 */
package com.shen.integration.callback;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.amqp.rabbit.connection.CorrelationData;
import org.springframework.amqp.rabbit.core.RabbitTemplate.ConfirmCallback;

/**
 * @author wangjunjie
 * @version $ Id: RabbitConfirmCallback.java, v 0.1  wangjunjie Exp $
 * @date 2019-09-18 15:09:45
 */
public class RabbitConfirmCallback implements ConfirmCallback {

    private static final Logger logger = LoggerFactory.getLogger(RabbitConfirmCallback.class);

    @Override
    public void confirm(CorrelationData correlationData, boolean b, String s) {
        //ack结果为true，表明正常接收到了消息
        if (!b) {
            logger.error("correlationData:" + correlationData + ",ack:" + b + ",cause:" + s);
        }
    }
}
